package com.shide.flow.demo.core;

import com.shide.flow.demo.engine.FlowEngine;
import com.shide.flow.demo.entity.FlowProcess;
import com.shide.flow.demo.service.FlowProcessService;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

/**
 * @author yuwg
 */
@Data
@Slf4j
public class FlowContext {

    private FlowProcessService flowProcessService;

    /**
     * 初始化引擎上下文
     *
     * @param flowEngine 流程引擎
     * @return 上下文
     */
    public FlowContext build(FlowEngine flowEngine) {
        if (log.isInfoEnabled()) {
            log.info("flowEngine start .....");
        }
        flowEngine.configure(this);
        return this;
    }
}
